﻿Module Module1

    Sub Main()
        Dim Assembledata As New BuildData
        Dim LibPath As String = ""
        Dim ProjectFile As String = ""
        Dim OutputFile As String = ""
        Try
            LibPath = FixPath(My.Application.CommandLineArgs(0).Trim())
            ProjectFile = FixPath(My.Application.CommandLineArgs(1).Trim())
            OutputFile = FixPath(My.Application.CommandLineArgs(2).Trim())
            If LibPath <> "" And ProjectFile <> "" And OutputFile <> "" Then
                Assembledata.Run(LibPath, ProjectFile, OutputFile)
            End If
        Catch ex As Exception
            Console.WriteLine("QuickAssemble LibPath Projectfile OutputFile")
            Console.WriteLine("")
            Console.WriteLine("")
            Console.WriteLine("Lib Path: " & LibPath)
            Console.WriteLine("")
            Console.WriteLine("Project File: " & ProjectFile)
            Console.WriteLine("")
            Console.WriteLine("Output File: " & OutputFile)
            Console.WriteLine("")
            Console.WriteLine("")
            Console.WriteLine(ex.Message)
        End Try
    End Sub
    Public Function FixPath(ByVal Path As String) As String
        If Path.StartsWith(".\") Then
            Return Path.Replace(".\", My.Application.Info.DirectoryPath & "\")
        Else
            Return Path
        End If
    End Function
End Module
